/*
 * @Author: szx
 * @Date: 2022-01-21 14:16:28
 * @LastEditTime: 2022-01-21 14:21:39
 * @Description:
 * @FilePath: \leetcode\600-699\674\674.js
 */
/**
 * @param {number[]} nums
 * @return {number}
 */
var findLengthOfLCIS = function (nums) {
    let res = 1;
    let tmp = 1;
    for (let i = 1; i < nums.length; i++) {
        if (nums[i] > nums[i - 1]) tmp++;
        else {
            res = Math.max(res, tmp);
            tmp = 1;
        }
    }
    return Math.max(res, tmp);
};

// 动态规划
var findLengthOfLCIS = function (nums) {
    const dp = new Array(nums.length).fill(1);
    for (let i = 0; i < nums.length - 1; i++) {
        if (nums[i + 1] > nums[i]) dp[i + 1] = d[i] + 1;
        if (dp[i + 1] > res) res = dp[i + 1];
    }
    return res;
};
